package com.test;

import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Random;

public class Main {
	/** 未状态 */
	public static final int STATUS_NO = 0;
	/** 已状态 */
	public static final int STATUS_YES = 1;

	public static final List<Integer> STATUS_LIST = Collections.unmodifiableList(Arrays.asList(STATUS_NO, STATUS_YES));

	public static String namedFile() {
		StringBuffer sb = new StringBuffer();
		Date date = new Date();
		sb.append(new SimpleDateFormat("yyyyMMddHHmmss").format(date));
		String milli = String.valueOf(date.getTime() % 1000);
		while (milli.length() < 3) {
			milli = "0" + milli;
		}
		sb.append(milli);
		String rondom = String.valueOf(new Random().nextInt(10000));
		while (rondom.length() < 4) {
			rondom = "0" + rondom;
		}
		sb.append(rondom);
		String fileName = sb.toString();
		return fileName;
	}

	public static void sss() {
		System.err.println("1235");
	}

	public static void main(String[] args) {
		String str = ".12341324";
		if (str.indexOf(".") > -1) {
			System.out.println(true);
			System.out.println(str.substring(str.indexOf(".") + 1, str.length()));
		} else {
			System.out.println(false);
		}
	}
}
